package com.yu.waterstation.system.modules.app.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yu.waterstation.common.common.exception.ServiceException;
import com.yu.waterstation.common.entity.app.Address;
import com.yu.waterstation.common.entity.system.vo.AddressVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 *
 *
 * date 2020-12-02 18:16:20
 */
public interface AddressService {


    /**
     * 模糊查询查询
     * 联合主键(collegeId, dorm, room)
     *
     * @param dorm required = false
     * @param room required = false
     * @return
     */
    Page<AddressVO> getAddressesByConditions(String dorm, String room, int pageNo, int pageSize) throws ServiceException;

    /**
     * 所有楼舍
     * @return
     */
    List<?> getDormList() throws ServiceException;

    /**
     * 楼舍所有寝室
     * @return
     */
    List<?> getRoomsOfDorm(String dorm) throws ServiceException;

    /**
     * 增加
     *
     * @param address
     */
    int addAddress(Address address) throws ServiceException;

    /**
     * 批量删除
     *
     * @param addressIdList
     */
    int deleteAddressBatchIds(List<Integer> addressIdList) throws ServiceException;

    /**
     * 修改
     *
     * @param address
     */
    int updateAddress(Address address) throws ServiceException;

    /**
     * 切换叫水状态（叫水或取消叫水）
     * @return
     */
    void changeTaskStatus(Integer addressId, HttpServletRequest request) throws ServiceException;

}

